package com.sodaopen.study.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.sodaopen.study.utils.LoginInterceptor;


@Configuration
public class MvcConfig implements WebMvcConfigurer  {

    public void addInterceptors(InterceptorRegistry registry){
        registry.addInterceptor(new LoginInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/login")
                .excludePathPatterns("/doAjaxLogin")
                .excludePathPatterns("/favicon.ico")
                .excludePathPatterns("/api/**")
                .excludePathPatterns("/css/**")
                .excludePathPatterns("/images/**")
                .excludePathPatterns("/js/**")
                .excludePathPatterns("/lib/**")
                .excludePathPatterns("/page/**");
    }
}
